package cn.qiao.mdc.jdk;

import java.lang.reflect.Proxy;

@SuppressWarnings("unchecked")
public class MDCProxyFactory {

    public static <T> T create(Object target, Class<T> interfaceType) {
        return (T) Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(), new Class[]{interfaceType}, new MDCInterceptor(target));
    }
}
